package daw.agenda.dao.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import oracle.jdbc.driver.OracleDriver;


public class Conexion {
    private static Conexion instance;
    
    private Conexion() {
    }
    
    public static Conexion getInstance(){
        if (instance==null)
            instance = new Conexion();
        
        return instance;
    }
    
    public Connection getConexion(){
        String cadenaConexion = "jdbc:oracle:thin:@150.214.142.20:1521:orc1";
        Connection conex = null;
        try{
           DriverManager.registerDriver(new OracleDriver());
           conex = DriverManager.getConnection(cadenaConexion, "scott", "kepa");
        } catch(SQLException sqlEx){
            System.out.println("Error al crear la conexion: "+sqlEx);
        }
        return conex;
    }
}
